using UnityEngine;
using UnityEngine.UI;

public class ServerInfo : MonoBehaviour
{
	public Text NameServer;

	public Text playerNumber;

	public Text GameMode;

	public Text GameMap;

	public new string name;

	public void JoinRoom()
	{
		RoomInfo[] roomList = PhotonNetwork.GetRoomList();
		foreach (RoomInfo roomInfo in roomList)
		{
			if (name == roomInfo.name)
			{
				if (roomInfo.playerCount != roomInfo.maxPlayers)
				{
					PlayerPrefs.SetString("LoadMap", string.Empty);
					PhotonNetwork.JoinRoom(name);
				}
				break;
			}
		}
	}
}
